import { View, AppEvent, ViewSettings } from "../../framework/framework";

class CartonView extends View implements IView {

  constructor(metiator: IMediator) {
    super(metiator);
  }

  public initialize(): void {
    this.subscribeToEvents([
      new AppEvent("app.view.carton.news_article", null, (e, model: any) => { this.news_article(model) }),
      new AppEvent("app.view.carton.user_info", null, (e, model: any) => { this.user_info(model) })
    ]);
  }
  public dispose() {
    this.unsubscribeToEvents();
  }
  public news_article(list) {
    this.triggerEvent(new AppEvent("app.sendjson", list, null));
  }
  public user_info(list) {
    this.triggerEvent(new AppEvent("app.sendjson", list, null));
  }
}

export { CartonView };
